#include "CRebar.h"

CRebar::CRebar() {
  m_hRebar = NULL;
}

void CRebar::SetHandle(HWND hRebar) {
  m_hRebar = hRebar;
}

HWND CRebar::GetHandle() {
  return m_hRebar;
}

HWND CRebar::Create(UINT nStyle, HWND hParentWnd, UINT nID) {
  m_hRebar = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL, WS_CHILD |
      WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CCS_NODIVIDER | nStyle,
      0, 0, 0, 0, hParentWnd, (HMENU)(long long)nID, NULL, NULL);
  return m_hRebar;
}

BOOL CRebar::Destroy() {
  return DestroyWindow(m_hRebar);
}

INT CRebar::BeginDrag(UINT uBand, DWORD dwPos) {
  return ::SendMessage(m_hRebar, RB_BEGINDRAG, (LPARAM)uBand, (WPARAM)dwPos);
}

INT CRebar::DeleteBand(UINT nIndex) {
  return ::SendMessage(m_hRebar, RB_DELETEBAND, (WPARAM)nIndex, (LPARAM)0);
}

INT CRebar::DragMove(DWORD dwPos) {
  return ::SendMessage(m_hRebar, RB_DRAGMOVE, (WPARAM)0, (WPARAM)dwPos);
}

INT CRebar::EndDrag() {
  return ::SendMessage(m_hRebar, RB_ENDDRAG, (WPARAM)0, (LPARAM)0);
}

INT CRebar::GetBandBorders(UINT uBand, LPRECT lprc) {
  return ::SendMessage(m_hRebar, RB_GETBANDBORDERS, (LPARAM)uBand,
      (WPARAM)lprc);
}

INT CRebar::GetBandCount() {
  return ::SendMessage(m_hRebar, RB_GETBANDCOUNT, (WPARAM)0, (LPARAM)0);
}

INT CRebar::GetBandInfo(UINT uBand, LPREBARBANDINFO lprbbi) {
  return ::SendMessage(m_hRebar, RB_GETBANDINFO, (WPARAM)uBand, (LPARAM)lprbbi);
}

INT CRebar::GetBandMargins(PMARGINS pMargins) {
  return ::SendMessage(m_hRebar, RB_GETBANDMARGINS, (WPARAM)0,
      (LPARAM)pMargins);
}

INT CRebar::GetBarHeight() {
  return ::SendMessage(m_hRebar, RB_GETBARHEIGHT, (WPARAM)0, (LPARAM)0);
}

INT CRebar::GetBarInfo(LPREBARINFO lprbi) {
  return ::SendMessage(m_hRebar, RB_GETBARINFO, (WPARAM)0, (LPARAM)lprbi);
}

INT CRebar::GetBkColor() {
  return ::SendMessage(m_hRebar, RB_GETBKCOLOR, (WPARAM)0, (LPARAM)0);
}

INT CRebar::GetColorScheme(LPCOLORSCHEME lpcs) {
  return ::SendMessage(m_hRebar, RB_GETCOLORSCHEME, (WPARAM)0, (LPARAM)lpcs);
}

INT CRebar::GetDropTarget(IDropTarget * ppDropTarget) {
  return ::SendMessage(m_hRebar, RB_GETDROPTARGET, (WPARAM)0,
      (LPARAM)&ppDropTarget);
}

INT CRebar::GetExtendedStyle() {
  return ::SendMessage(m_hRebar, RB_GETEXTENDEDSTYLE, (WPARAM)0, (LPARAM)0);
}

INT CRebar::GetPalette() {
  return ::SendMessage(m_hRebar, RB_GETPALETTE, (WPARAM)0, (LPARAM)0);
}

INT CRebar::GetRect(UINT uBand, LPRECT lprc) {
  return ::SendMessage(m_hRebar, RB_GETRECT, (WPARAM)uBand, (LPARAM)lprc);
}

INT CRebar::GetRowCount() {
  return ::SendMessage(m_hRebar, RB_GETROWCOUNT, (WPARAM)0, (LPARAM)0);
}

INT CRebar::GetRowHeight(UINT uBand) {
  return ::SendMessage(m_hRebar, RB_GETROWHEIGHT, (WPARAM)0, (LPARAM)0);
}

INT CRebar::GetTextColor() {
  return ::SendMessage(m_hRebar, RB_GETTEXTCOLOR, (WPARAM)0, (LPARAM)0);
}

INT CRebar::GetTooltips() {
  return ::SendMessage(m_hRebar, RB_GETTOOLTIPS, (WPARAM)0, (LPARAM)0);
}

INT CRebar::GetUnicodeFormat() {
  return ::SendMessage(m_hRebar, RB_GETUNICODEFORMAT, (WPARAM)0, (LPARAM)0);
}

INT CRebar::HitTest(LPRBHITTESTINFO lprbht) {
  return ::SendMessage(m_hRebar, RB_HITTEST, (WPARAM)0, (LPARAM)lprbht);
}

INT CRebar::IDToIndex(UINT uBandID) {
  return ::SendMessage(m_hRebar, RB_IDTOINDEX, (WPARAM)0, (LPARAM)0);
}

INT CRebar::InsertBand(UINT nIndex, LPREBARBANDINFO lpBandInfo) {
  return ::SendMessage(m_hRebar, RB_INSERTBAND, (WPARAM)nIndex,
      (LPARAM)lpBandInfo);
}

INT CRebar::MaximizedBand(UINT uBand, BOOL fIdeal) {
  return ::SendMessage(m_hRebar, RB_MAXIMIZEBAND, (WPARAM)uBand,
      (LPARAM)fIdeal);
}

INT CRebar::MinimizeBand(UINT uBand) {
  return ::SendMessage(m_hRebar, RB_MINIMIZEBAND, (WPARAM)0, (LPARAM)uBand);
}

INT CRebar::MoveBand(UINT iFrom, UINT iTo) {
  return ::SendMessage(m_hRebar, RB_MOVEBAND, (WPARAM)iFrom, (LPARAM)iTo);
}

INT CRebar::PushChevron(UINT uBand, long lAppValue) {
  return ::SendMessage(m_hRebar, RB_PUSHCHEVRON, (WPARAM)uBand,
      (LPARAM)lAppValue);
}

INT CRebar::SetBandInfo(UINT uBand, LPREBARBANDINFO lprbbi) {
  return ::SendMessage(m_hRebar, RB_SETBANDINFO, (WPARAM)uBand, (LPARAM)lprbbi);
}

INT CRebar::SetBandWidth(UINT uBand, UINT nWidth) {
  return ::SendMessage(m_hRebar, RB_SETBANDWIDTH, (WPARAM)uBand,
      (LPARAM)nWidth);
}

INT CRebar::SetBarInfo(LPREBARINFO lprbi) {
  return ::SendMessage(m_hRebar, RB_SETBARINFO, (WPARAM)0, (LPARAM)lprbi);
}

INT CRebar::SetBkColor(COLORREF clrBk) {
  return ::SendMessage(m_hRebar, RB_SETBKCOLOR, (WPARAM)0, (LPARAM)clrBk);
}

INT CRebar::SetColorScheme(LPCOLORSCHEME lpcs) {
  return ::SendMessage(m_hRebar, RB_SETCOLORSCHEME, (WPARAM)0, (LPARAM)lpcs);
}

INT CRebar::SetExtendedStyle(UINT nFlags, UINT nStyles) {
  return ::SendMessage(m_hRebar, RB_SETEXTENDEDSTYLE, (WPARAM)nFlags,
      (LPARAM)nStyles);
}

INT CRebar::SetPalette(HPALETTE hpal) {
  return ::SendMessage(m_hRebar, RB_SETPALETTE, (WPARAM)0, (LPARAM)hpal);
}

INT CRebar::SetParent(HWND hParent) {
  return ::SendMessage(m_hRebar, RB_SETPARENT, (WPARAM)hParent, (LPARAM)0);
}

INT CRebar::SetTextColor(COLORREF clrText) {
  return ::SendMessage(m_hRebar, RB_SETTEXTCOLOR, (WPARAM)0, (LPARAM)clrText);
}

INT CRebar::SetToolTips(HWND hTooltip) {
  return ::SendMessage(m_hRebar, RB_SETTOOLTIPS, (WPARAM)hTooltip, (LPARAM)0);
}

INT CRebar::SetUnicodeFormat(BOOL bUnicode) {
  return ::SendMessage(m_hRebar, RB_SETUNICODEFORMAT, (WPARAM)bUnicode,
      (LPARAM)0);
}

INT CRebar::SetWindowTheme(LPWSTR pwStr) {
  return ::SendMessage(m_hRebar, RB_SETWINDOWTHEME, (WPARAM)0, (LPARAM)pwStr);
}

INT CRebar::ShowBand(UINT uBand, BOOL fShow) {
  return ::SendMessage(m_hRebar, RB_SHOWBAND, (WPARAM)uBand, (LPARAM)fShow);
}

INT CRebar::SizeToRect(LPRECT prc) {
  return ::SendMessage(m_hRebar, RB_SIZETORECT, (WPARAM)0, (LPARAM)prc);
}

